1. Field of the Invention
The present invention generally relates to processing graphics data and, more specifically, to a technique for storing shared vertices.
2. Description of the Related Art
A conventional graphics processing unit (GPU) typically implements a graphics processing pipeline that includes a sequence of graphics processing stages. At each stage in the graphics processing pipeline, the GPU may perform one or more different graphics-oriented processing operations. For example, at one stage, the GPU could assemble a set of primitives that represent a graphics scene, and at a subsequent stage the GPU could perform shading operations with vertices associated with that set of primitives. Finally, the GPU could rasterize those vertices into pixels that represent the graphics scene.
A GPU that implements a conventional graphics processing pipeline, such as that described in the above example, typically includes a geometry shading unit configured to perform shading operations with vertices and geometry-based information and to then output one or more graphics primitives or one or more geometry objects of relatively greater complexity to a subsequent unit for rasterization. For each generated graphics primitive or geometry object, the geometry shading unit outputs vertex data corresponding to each vertex associated with that graphics primitive or geometry object. For example, when processing a triangle, the geometry shading unit would output vertex data for each of the three vertices of that triangle. Vertex data for a given vertex could describe the position of the vertex within the scene, coverage data associated with the vertex, or a set of attributes associated with the vertex, among other things. When generating graphics primitives or geometry objects, the geometry shading unit typically stores each generated graphics primitive or each graphics primitive making up all or a portion of a generated geometry object as the set of vertices associated with that primitive and the vertex data corresponding to each vertex in that set.
Again, in some situations, the geometry shading unit may generate a geometry object that includes a collection of interconnected graphics primitives that share vertices. The geometry object could be, e.g., a fan, a strip or a mesh type of geometry object. For example, a given graphics scene could include numerous individual graphics primitives interconnected in a fan, a strip or a mesh to create the appearance of a surface having an arbitrary shape. Each graphics primitive within the surface could be connected to a neighboring graphics primitive by one or more vertices shared between the two graphics primitives. In other situations, multiple geometry objects, such as triangles or strips, that share one or more common vertices may be generated by the geometry shading unit.
In these different situations, the geometry shading unit typically stores redundant copies of the vertex data associated with each vertex shared between graphics primitives or geometry objects. However, this approach is problematic because a typical graphics scene may include millions of shared vertices. Consequently, a conventional geometry shading unit may store millions of copies of redundant data. Processing this redundant data consumes GPU resources inefficiently and may reduce the speed with which a graphics scene may be rendered.
Accordingly, what is needed in the art is an improved technique for processing vertices shared between graphics primitives or geometry objects within a graphics scene.